<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>libwebsockets: HTTP headers: read</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="libwebsockets.org-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libwebsockets
   </div>
   <div id="projectbrief">Lightweight C library for HTML5 websockets</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__HTTP-headers-read.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">HTTP headers: read<div class="ingroups"><a class="el" href="group__http.html">HTTP</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlws__tokens.html">lws_tokens</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlws__token__limits.html">lws_token_limits</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga6e747906f9d76532ec118d6ef418b82e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6e747906f9d76532ec118d6ef418b82e"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>lws_token_indexes</b> { <br />
&#160;&#160;<b>WSI_TOKEN_GET_URI</b> = 0, 
<b>WSI_TOKEN_POST_URI</b> = 1, 
<b>WSI_TOKEN_OPTIONS_URI</b> = 2, 
<b>WSI_TOKEN_HOST</b> = 3, 
<br />
&#160;&#160;<b>WSI_TOKEN_CONNECTION</b> = 4, 
<b>WSI_TOKEN_UPGRADE</b> = 5, 
<b>WSI_TOKEN_ORIGIN</b> = 6, 
<b>WSI_TOKEN_DRAFT</b> = 7, 
<br />
&#160;&#160;<b>WSI_TOKEN_CHALLENGE</b> = 8, 
<b>WSI_TOKEN_EXTENSIONS</b> = 9, 
<b>WSI_TOKEN_KEY1</b> = 10, 
<b>WSI_TOKEN_KEY2</b> = 11, 
<br />
&#160;&#160;<b>WSI_TOKEN_PROTOCOL</b> = 12, 
<b>WSI_TOKEN_ACCEPT</b> = 13, 
<b>WSI_TOKEN_NONCE</b> = 14, 
<b>WSI_TOKEN_HTTP</b> = 15, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP2_SETTINGS</b> = 16, 
<b>WSI_TOKEN_HTTP_ACCEPT</b> = 17, 
<b>WSI_TOKEN_HTTP_AC_REQUEST_HEADERS</b> = 18, 
<b>WSI_TOKEN_HTTP_IF_MODIFIED_SINCE</b> = 19, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_IF_NONE_MATCH</b> = 20, 
<b>WSI_TOKEN_HTTP_ACCEPT_ENCODING</b> = 21, 
<b>WSI_TOKEN_HTTP_ACCEPT_LANGUAGE</b> = 22, 
<b>WSI_TOKEN_HTTP_PRAGMA</b> = 23, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_CACHE_CONTROL</b> = 24, 
<b>WSI_TOKEN_HTTP_AUTHORIZATION</b> = 25, 
<b>WSI_TOKEN_HTTP_COOKIE</b> = 26, 
<b>WSI_TOKEN_HTTP_CONTENT_LENGTH</b> = 27, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_CONTENT_TYPE</b> = 28, 
<b>WSI_TOKEN_HTTP_DATE</b> = 29, 
<b>WSI_TOKEN_HTTP_RANGE</b> = 30, 
<b>WSI_TOKEN_HTTP_REFERER</b> = 31, 
<br />
&#160;&#160;<b>WSI_TOKEN_KEY</b> = 32, 
<b>WSI_TOKEN_VERSION</b> = 33, 
<b>WSI_TOKEN_SWORIGIN</b> = 34, 
<b>WSI_TOKEN_HTTP_COLON_AUTHORITY</b> = 35, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_COLON_METHOD</b> = 36, 
<b>WSI_TOKEN_HTTP_COLON_PATH</b> = 37, 
<b>WSI_TOKEN_HTTP_COLON_SCHEME</b> = 38, 
<b>WSI_TOKEN_HTTP_COLON_STATUS</b> = 39, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_ACCEPT_CHARSET</b> = 40, 
<b>WSI_TOKEN_HTTP_ACCEPT_RANGES</b> = 41, 
<b>WSI_TOKEN_HTTP_ACCESS_CONTROL_ALLOW_ORIGIN</b> = 42, 
<b>WSI_TOKEN_HTTP_AGE</b> = 43, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_ALLOW</b> = 44, 
<b>WSI_TOKEN_HTTP_CONTENT_DISPOSITION</b> = 45, 
<b>WSI_TOKEN_HTTP_CONTENT_ENCODING</b> = 46, 
<b>WSI_TOKEN_HTTP_CONTENT_LANGUAGE</b> = 47, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_CONTENT_LOCATION</b> = 48, 
<b>WSI_TOKEN_HTTP_CONTENT_RANGE</b> = 49, 
<b>WSI_TOKEN_HTTP_ETAG</b> = 50, 
<b>WSI_TOKEN_HTTP_EXPECT</b> = 51, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_EXPIRES</b> = 52, 
<b>WSI_TOKEN_HTTP_FROM</b> = 53, 
<b>WSI_TOKEN_HTTP_IF_MATCH</b> = 54, 
<b>WSI_TOKEN_HTTP_IF_RANGE</b> = 55, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_IF_UNMODIFIED_SINCE</b> = 56, 
<b>WSI_TOKEN_HTTP_LAST_MODIFIED</b> = 57, 
<b>WSI_TOKEN_HTTP_LINK</b> = 58, 
<b>WSI_TOKEN_HTTP_LOCATION</b> = 59, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_MAX_FORWARDS</b> = 60, 
<b>WSI_TOKEN_HTTP_PROXY_AUTHENTICATE</b> = 61, 
<b>WSI_TOKEN_HTTP_PROXY_AUTHORIZATION</b> = 62, 
<b>WSI_TOKEN_HTTP_REFRESH</b> = 63, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_RETRY_AFTER</b> = 64, 
<b>WSI_TOKEN_HTTP_SERVER</b> = 65, 
<b>WSI_TOKEN_HTTP_SET_COOKIE</b> = 66, 
<b>WSI_TOKEN_HTTP_STRICT_TRANSPORT_SECURITY</b> = 67, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_TRANSFER_ENCODING</b> = 68, 
<b>WSI_TOKEN_HTTP_USER_AGENT</b> = 69, 
<b>WSI_TOKEN_HTTP_VARY</b> = 70, 
<b>WSI_TOKEN_HTTP_VIA</b> = 71, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_WWW_AUTHENTICATE</b> = 72, 
<b>WSI_TOKEN_PATCH_URI</b> = 73, 
<b>WSI_TOKEN_PUT_URI</b> = 74, 
<b>WSI_TOKEN_DELETE_URI</b> = 75, 
<br />
&#160;&#160;<b>WSI_TOKEN_HTTP_URI_ARGS</b> = 76, 
<b>WSI_TOKEN_PROXY</b> = 77, 
<b>WSI_TOKEN_HTTP_X_REAL_IP</b> = 78, 
<b>WSI_TOKEN_HTTP1_0</b> = 79, 
<br />
&#160;&#160;<b>_WSI_TOKEN_CLIENT_SENT_PROTOCOLS</b>, 
<b>_WSI_TOKEN_CLIENT_PEER_ADDRESS</b>, 
<b>_WSI_TOKEN_CLIENT_URI</b>, 
<b>_WSI_TOKEN_CLIENT_HOST</b>, 
<br />
&#160;&#160;<b>_WSI_TOKEN_CLIENT_ORIGIN</b>, 
<b>_WSI_TOKEN_CLIENT_METHOD</b>, 
<b>WSI_TOKEN_COUNT</b>, 
<b>WSI_TOKEN_NAME_PART</b>, 
<br />
&#160;&#160;<b>WSI_TOKEN_SKIPPING</b>, 
<b>WSI_TOKEN_SKIPPING_SAW_CR</b>, 
<b>WSI_PARSING_COMPLETE</b>, 
<b>WSI_INIT_TOKEN_MUXURL</b>
<br />
 }</td></tr>
<tr class="separator:ga6e747906f9d76532ec118d6ef418b82e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2c0597b2ef1d2cee35736c338bcbd17b"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN const unsigned char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__HTTP-headers-read.html#ga2c0597b2ef1d2cee35736c338bcbd17b">lws_token_to_string</a> (enum lws_token_indexes token)</td></tr>
<tr class="separator:ga2c0597b2ef1d2cee35736c338bcbd17b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8ade0e1ffb0da7e62b989d8d867bf6c8"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__HTTP-headers-read.html#ga8ade0e1ffb0da7e62b989d8d867bf6c8">lws_hdr_total_length</a> (struct lws *wsi, enum lws_token_indexes h)</td></tr>
<tr class="separator:ga8ade0e1ffb0da7e62b989d8d867bf6c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga594f3d0ece5b09c2ccf9f98ea533bb4e"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__HTTP-headers-read.html#ga594f3d0ece5b09c2ccf9f98ea533bb4e">lws_hdr_fragment_length</a> (struct lws *wsi, enum lws_token_indexes h, int frag_idx)</td></tr>
<tr class="separator:ga594f3d0ece5b09c2ccf9f98ea533bb4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6ce6aa1c0155ea42b7708bed271d1c77"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__HTTP-headers-read.html#ga6ce6aa1c0155ea42b7708bed271d1c77">lws_hdr_copy</a> (struct lws *wsi, char *dest, int len, enum lws_token_indexes h)</td></tr>
<tr class="separator:ga6ce6aa1c0155ea42b7708bed271d1c77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa427cad61a9a5e3004afd65c4527b5e9"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__HTTP-headers-read.html#gaa427cad61a9a5e3004afd65c4527b5e9">lws_hdr_copy_fragment</a> (struct lws *wsi, char *dest, int len, enum lws_token_indexes h, int frag_idx)</td></tr>
<tr class="separator:gaa427cad61a9a5e3004afd65c4527b5e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga84e9ce5e71a77501a0998ac403a984c2"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__HTTP-headers-read.html#ga84e9ce5e71a77501a0998ac403a984c2">lws_get_urlarg_by_name</a> (struct lws *wsi, const char *name, char *buf, int len)</td></tr>
<tr class="separator:ga84e9ce5e71a77501a0998ac403a984c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2>HTTP header releated functions</h2>
<p>In lws the client http headers are temporarily stored in a pool, only for the duration of the http part of the handshake. It's because in most cases, the header content is ignored for the whole rest of the connection lifetime and would then just be taking up space needlessly.</p>
<p>During LWS_CALLBACK_HTTP when the URI path is delivered is the last time the http headers are still allocated, you can use these apis then to look at and copy out interesting header content (cookies, etc)</p>
<p>Notice that the header total length reported does not include a terminating '\0', however you must allocate for it when using the _copy apis. So the length reported for a header containing "123" is 3, but you must provide a buffer of length 4 so that "123\0" may be copied into it, or the copy will fail with a nonzero return code.</p>
<p>In the special case of URL arguments, like ?x=1&amp;y=2, the arguments are stored in a token named for the method, eg, WSI_TOKEN_GET_URI if it was a GET or WSI_TOKEN_POST_URI if POST. You can check the total length to confirm the method.</p>
<p>For URL arguments, each argument is stored urldecoded in a "fragment", so you can use the fragment-aware api <a class="el" href="group__HTTP-headers-read.html#gaa427cad61a9a5e3004afd65c4527b5e9">lws_hdr_copy_fragment()</a> to access each argument in turn: the fragments contain urldecoded strings like x=1 or y=2.</p>
<p>As a convenience, lws has an api that will find the fragment with a given name= part, <a class="el" href="group__HTTP-headers-read.html#ga84e9ce5e71a77501a0998ac403a984c2">lws_get_urlarg_by_name()</a>. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga84e9ce5e71a77501a0998ac403a984c2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN const char* lws_get_urlarg_by_name </td>
          <td>(</td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__HTTP-headers-read.html#ga84e9ce5e71a77501a0998ac403a984c2">lws_get_urlarg_by_name()</a> - return pointer to arg value if present </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>the connection to check </td></tr>
    <tr><td class="paramname">name</td><td>the arg name, like "token=" </td></tr>
    <tr><td class="paramname">buf</td><td>the buffer to receive the urlarg (including the name= part) </td></tr>
    <tr><td class="paramname">len</td><td>the length of the buffer to receive the urlarg <pre class="fragment">Returns NULL if not found or a pointer inside buf to just after the
name= part.</pre> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga6ce6aa1c0155ea42b7708bed271d1c77"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_hdr_copy </td>
          <td>(</td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>dest</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum lws_token_indexes&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__HTTP-headers-read.html#ga6ce6aa1c0155ea42b7708bed271d1c77">lws_hdr_copy()</a> - copy a single fragment of the given header to a buffer The buffer length len must include space for an additional terminating '\0', or it will fail returning -1.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>websocket connection </td></tr>
    <tr><td class="paramname">dest</td><td>destination buffer </td></tr>
    <tr><td class="paramname">len</td><td>length of destination buffer </td></tr>
    <tr><td class="paramname">h</td><td>which header index we are interested in</td></tr>
  </table>
  </dd>
</dl>
<p>copies the whole, aggregated header, even if it was delivered in several actual headers piece by piece </p>

</div>
</div>
<a class="anchor" id="gaa427cad61a9a5e3004afd65c4527b5e9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_hdr_copy_fragment </td>
          <td>(</td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>dest</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum lws_token_indexes&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>frag_idx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__HTTP-headers-read.html#gaa427cad61a9a5e3004afd65c4527b5e9">lws_hdr_copy_fragment()</a> - copy a single fragment of the given header to a buffer The buffer length len must include space for an additional terminating '\0', or it will fail returning -1. If the requested fragment index is not present, it fails returning -1.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>websocket connection </td></tr>
    <tr><td class="paramname">dest</td><td>destination buffer </td></tr>
    <tr><td class="paramname">len</td><td>length of destination buffer </td></tr>
    <tr><td class="paramname">h</td><td>which header index we are interested in </td></tr>
    <tr><td class="paramname">frag_idx</td><td>which fragment of h we want to copy</td></tr>
  </table>
  </dd>
</dl>
<p>Normally this is only useful to parse URI arguments like ?x=1&amp;y=2, token index WSI_TOKEN_HTTP_URI_ARGS fragment 0 will contain "x=1" and fragment 1 "y=2" </p>

</div>
</div>
<a class="anchor" id="ga594f3d0ece5b09c2ccf9f98ea533bb4e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_hdr_fragment_length </td>
          <td>(</td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum lws_token_indexes&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>frag_idx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p>lws_hdr_fragment_length: report length of a single fragment of a header The returned length does not include the space for a terminating '\0'</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>websocket connection </td></tr>
    <tr><td class="paramname">h</td><td>which header index we are interested in </td></tr>
    <tr><td class="paramname">frag_idx</td><td>which fragment of h we want to get the length of </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga8ade0e1ffb0da7e62b989d8d867bf6c8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_hdr_total_length </td>
          <td>(</td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum lws_token_indexes&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p>lws_hdr_total_length: report length of all fragments of a header totalled up The returned length does not include the space for a terminating '\0'</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>websocket connection </td></tr>
    <tr><td class="paramname">h</td><td>which header index we are interested in </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga2c0597b2ef1d2cee35736c338bcbd17b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN const unsigned char* lws_token_to_string </td>
          <td>(</td>
          <td class="paramtype">enum lws_token_indexes&#160;</td>
          <td class="paramname"><em>token</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__HTTP-headers-read.html#ga2c0597b2ef1d2cee35736c338bcbd17b">lws_token_to_string()</a> - returns a textual representation of a hdr token index</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
